//
/**
 * */
Rsd.define('Rsd.Faith.pages.ReportFenHuZhangListPage', {
    extend: 'Rsd.Faith.pages.ListPage',
    requires: [
        'Rsd.controlEx.ComboBoxEnum',
        'Rsd.Faith.controls.XiaoQuInput',
        'Rsd.Faith.controls.SuoShuQiInput'
    ],
    xtype: 'list-r-fen-hu',
    border: false,
    tabTitle: '分户账',
    searchColumns:[
        {name:'SuoShuQi',"text": "所属期",width:250,xtype:'ctrl-suoshuqi',required:true,selectedIndex:0,nullText:null},
        {name:'XiaoQuBianHao',text:'小区编号',width:250},
        {name:'FangWuBianHao',text:'房屋编号',width:250},
        {name:'ZhangHuBianHao',text:'账户编号',width:250}],
    newButtons:[{text:'重新核算',handler:'reportHs'}],
    modelType:'ReportFenHuZhangMuModel',
    readOnly:false,
    formFields: [],
    gridColumns: [
        {
            "text": "序号",
            "xtype": "index",
            "width": 40,
            "index": 0
        },
        {
            "name": "SuoShuQi",
            "dataIndex": "SuoShuQi",
            "sortable": false,
            "text": "所属期",
             align:'center',
            "index": 20,
            "exist": true,
            "xtype": "string",
            "width": 80,
            "nobr": true
        },
        {
            "name": "XiaoQuBianHao",
            "dataIndex": "XiaoQuBianHao",
            "sortable": false,
            "text": "小区编号",
            "index": 24,
            "exist": true,
            "xtype": "ctrl-xiaoqu",
            "width": 100,
            "nobr": true
        },
        {
            "name": "FangWuBianHao",
            "dataIndex": "FangWuBianHao",
            "sortable": false,
            "text": "房屋编号",
            "index": 26,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },
        {
            "name": "ZhangHuBianHao",
            "dataIndex": "ZhangHuBianHao",
            "sortable": false,
            "text": "账户编号",
            "index": 23,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },

        {
            "name": "QiChuJinE",
            "dataIndex": "QiChuJinE",
            "sortable": false,
            "text": "期初金额",
            "index": 27,
            "exist": true,
            "xtype": "number",
            "width": 100,
            "precision": 2
        },
        {
            "name": "JiaoCunJinE",
            "dataIndex": "JiaoCunJinE",
            "sortable": false,
            "text": "缴存金额",
            "index": 28,
            "exist": true,
            "xtype": "number",
            "width": 100,
            "precision": 2
        },
        {
            "name": "ShouYiJinE",
            "dataIndex": "ShouYiJinE",
            "sortable": false,
            "text": "利息",
            "index": 29,
            "exist": true,
            "xtype": "number",
            "width": 100,
            "precision": 2
        },
        {
            "name": "ShiYongJinE",
            "dataIndex": "ShiYongJinE",
            "sortable": false,
            "text": "支出金额",
            "index": 30,
            "exist": true,
            "xtype": "number",
            "width": 100,
            "precision": 2
        },
        {
            "name": "YuE",
            "dataIndex": "YuE",
            "sortable": false,
            "text": "期末余额",
            "index": 32,
            "exist": true,
            "xtype": "number",
            "width": 100,
            "precision": 2
        },
        {
            "name": "ZhuangTai",
            "dataIndex": "ZhuangTai",
            "sortable": false,
            "text": "状态",
            "index": 34,
            "exist": true,
            "xtype": "enum",
            "enum": {
                "name": "Rsd.Faith.Core.ZhangMuZhuangTai",
                "valueMember": "code",
                "items": [
                    {
                        "code": "None",
                        "value": 0,
                        "text": "未设置"
                    },
                    {
                        "code": "null",
                        "value": 1,
                        "text": "记账中"
                    },
                    {
                        "code": "JZZ",
                        "value": 1,
                        "text": "记账中"
                    },
                    {
                        "code": "YHS",
                        "value": 2,
                        "text": "已扎帐"
                    }
                ]
            },
            "width": 100,
            "nobr": true
        },
        {
            "name": "Remark",
            "dataIndex": "Remark",
            "sortable": false,
            "text": "备注",
            "index": 200,
            "exist": true,
            "xtype": "string",
            "width": 50,
            "nobr": true
        }
    ],
    formTitle:'分户账',
    titleField : 'SuoShuQi',
    /*
     * */
    constructor: function (config) {
        config = config || {};
        Rsd.apply(this, config);
    },
    load:function load(args)
    {
        var _args = args||{suffix:new Date().getFullYear()};
        _args.where = _args.where ||this.toolBar.getWhere();
        if(_args.where)
        {
            for(var i in _args.where)
            {
                if(_args.where[i].name =="SuoShuQi")
                {
                    _args.suffix=_args.where[i].value.substr(3,4);
                    break;
                }
            }
        }
        this.callParent(_args);
    }
});